﻿using Core.SimpleTemp.Common;
using Core.SimpleTemp.Entitys;
using Core.Toolkit.DbInitializer;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.SimpleTemp.Repositories.FX
{
    /// <summary>
    /// 法律法规标准库
    /// </summary>
    public class A_FLFG_DBinit : DbInitializer
    {
        public override void Initialize(DbContext context, WebAppOptions _webAppOptions)
        {
            var zqNewDepartmentId = context.Set<SysDepartment>().FirstOrDefault().Id;

            for (int i = 0; i < 20; i++)
            {
                context.Set<FL_StandardInformation>().Add(new FL_StandardInformation
                {
                    LawRegulationsName = "法律法规名测试" + i,
                    IssueSubject = "发布主体test" + i,//发布主体
                                                  //UpdateTime=new ,//更改时间
                    ApplyClause = "test" + i,//适用条款
                    DescribeForWork = "对应工作情况描述" + i,//对应工作情况描述
                    Symbol = "文号/标准号" + i,//文号/标准号
                    IssueDate = DbInitializerHelp.GetRandomDate(),//颁布日期
                    ImplementationDate = DbInitializerHelp.GetRandomDate(),//实施日期
                    FL_StandardInformations = new List<FL_StandardInformationDept>() {
                         new FL_StandardInformationDept(){
                             Class=zqNewDepartmentId,
                             DeptType="1",
                             FitSituation="符合情况test1",
                             FitSituationOrNotDescribe="不符合描述test1"
                         },
                           new FL_StandardInformationDept(){
                               Class=zqNewDepartmentId,
                             DeptType="2",
                             FitSituation="符合情况test2",
                             FitSituationOrNotDescribe="不符合描述test2"
                         },
                             new FL_StandardInformationDept(){
                                 Class=zqNewDepartmentId,
                             DeptType="3",
                             FitSituation="符合情况test3",
                             FitSituationOrNotDescribe="不符合描述test3"
                         }
                    }

                });
            }
        }
    }
}
